package com.common.retrofit.bearusermethod;

import com.common.cons.Constans;
import com.common.retrofit.base.BaseMethods;
import com.common.retrofit.bean.GoodsDeatailsBean;
import com.common.retrofit.service.BearUserService;
import com.common.utils.SortUtils;

import rx.Observable;
import rx.Subscriber;

public class CollectionMethods extends BaseMethods {

    private static CollectionMethods m_ins = null;

    public static CollectionMethods getInstance() {
        if (m_ins == null) {
            synchronized (CollectionMethods.class) {
                if (m_ins == null) {
                    m_ins = new CollectionMethods();
                }
            }
        }
        return m_ins;
    }

    @Override
    protected String getHttpUrl() {
        return "api/Goods/";
    }

    private BearUserService initService() {
        return getRetrofit().create(BearUserService.class);
    }


    public void     goodCollection     (Subscriber<Object> subscriber , int uid, String hashid, String gid,String type ) {
        String time  = System.currentTimeMillis()+"" ;
        Observable observable = initService().goodCollection(time,SortUtils.getMyHash("uid"+uid,"hashid"+hashid ,"gid"+gid,"time"+time,"type"+type),Constans.ANDROID_APP_ID,"3"
                ,uid,hashid,gid,type);
        toSubscribe(observable, subscriber);
    }
}
